<?php
class Model {
	var $host = "localhost";
	var $username = "root";
	var $password = "";
	var $database = "docbao";
	var $conn;
	private function connect($host, $username, $password, $database) {
		$this->conn = mysql_connect ( $host, $username, $password ) or die ( "error serrver" );
		mysql_select_db ( $database ) or die ( "error database" );
		return $this->conn;
	}
	public function __construct() {
		$this->connect ( $this->host, $this->username, $this->password, $this->database );
	}
	public function Query($query) {
		return mysql_query ( $query );
	}
	public function closeDB() {
		if ($this->conn) {
			mysql_close ( $this->conn );
		}
	}
}